package com.clouddisk.file.chain;

import com.clouddisk.file.dto.FileUploadDTO;

/**
 * 文件操作责任链处理器接口
 */
public interface FileOperationHandler {
    /**
     * 处理文件操作
     */
    void handle(FileOperationContext context);

    /**
     * 设置下一个处理器
     */
    void setNext(FileOperationHandler next);
}

/**
 * 文件操作上下文
 */
class FileOperationContext {
    private Long userId;
    private FileUploadDTO uploadDTO;
    private String fileName;
    private String fileMd5;
    private String storagePath;
    private boolean shouldContinue = true;

    // getter和setter方法
    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public FileUploadDTO getUploadDTO() {
        return uploadDTO;
    }

    public void setUploadDTO(FileUploadDTO uploadDTO) {
        this.uploadDTO = uploadDTO;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getFileMd5() {
        return fileMd5;
    }

    public void setFileMd5(String fileMd5) {
        this.fileMd5 = fileMd5;
    }

    public String getStoragePath() {
        return storagePath;
    }

    public void setStoragePath(String storagePath) {
        this.storagePath = storagePath;
    }

    public boolean isShouldContinue() {
        return shouldContinue;
    }

    public void setShouldContinue(boolean shouldContinue) {
        this.shouldContinue = shouldContinue;
    }
} 